# -*- coding:utf-8 -*-


from Survey.Socket import *
import sys
import threading
import time
class ClientThread(threading.Thread):

    def __init__(self):
        super(ClientThread, self).__init__()
        self.clientId = 0
        self.sleepTime = 0
        self.client = None

    def run(self):
        self.client = TcpClient()
        self.client.id = self.clientId
        self.client.sleepTime = self.sleepTime
        self.client.start()




def main():
    arg = sys.argv
    id = arg[1]
    print("start client id {}".format(id))

    # client = TcpClient()
    # client.id = id
    # client.sleepTime = 3
    # client.start()

    clientThread = ClientThread()
    clientThread.clientId = id
    clientThread.sleepTime = 5
    clientThread.start()

    while True:
        # cmd = input("cmd:<<")
        time.sleep(3)
        clientThread.client.send_other()



if __name__ == '__main__':
    main()